package com.huilian.iotbox.data.enums;

import lombok.Getter;

/**
 * @author lizhiquan
 * @CreateDate: 2021-04-01-22-41
 * @Description:
 */
@Getter
public enum MemberIntegralRecordBusinessTypeEnum {
    COUNTER(1, "柜台办理"),
    SHOPPING(2, "会员兑换商城使用"),
    SHOPPING_REFUND(3, "兑换商城订单退币"),
    SEND_WELFARE(4, "派发福利"),
    COMMON_PAY(5, "普通支付获得"),
    ACTIVITY_PAY(6, "活动支付获得"),
    GROUP_PURCHASE(7, "团购核销获得"),
    MERCHANT_ADJUSTMENT(8, "商家调整积分余额"),

    REFUND_POINTS_FOR_ORDER_REFUND(9, "订单退款退积分"),
    ;

    private Integer code;
    private String desc;

    MemberIntegralRecordBusinessTypeEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static String formatDesc(Integer code){
        MemberIntegralRecordBusinessTypeEnum[] values = MemberIntegralRecordBusinessTypeEnum.values();
        String desc = null;
        for (int i = 0; i < values.length; i++) {
            if (values[i].code.compareTo(code) == 0){
                desc = values[i].desc;
                break;
            }
        }
        return desc;
    }
}
